<?php

abstract class BaseModele {

    function __construct(array $array = null) {
        if ($array != null) {
            foreach ($array as $key => $value) {
                $method = 'set' . ucfirst($key);
                if (is_callable(array($this, $method))) {
                    $this->$method($value);
                }
            }
        }
    }

}

?>